package leetcode.sword;

public class P17 {
    public static void main(String[] args) {
        int[] a = printNumbers(4);
        System.out.println(a[a.length-1]);

    }
    public static int[] printNumbers(int n) {
        int nBitMaxNum = (int)Math.pow(10,n)-1; //n位最大的数是多少
        int[] res = new int[nBitMaxNum];
        while (nBitMaxNum>0){
            res[nBitMaxNum-1] = nBitMaxNum;
            nBitMaxNum--;
        }
        return res;
    }
}
